#include <bits/stdc++.h>
using namespace std;
#define yes cout << "YES" << endl
#define no cout << "NO" << endl
using ll = long long;
void solve()
{
    string s;
    cin >> s;
    ll x = 0, y = 0;
    for (auto &i : s)
    {
        if(i=='U')
        {
            y++;
        }
        else if(i=='D')
        {
            y--;
        }
        else if(i=='L')
        {
            x--;
        }
        else
            x++;
    }
    cout << x <<" "<< y;
}
int main()
{
    int t = 1;
    // cin >> t;
    while (t--)
    {
        solve();
    }
    return 0;
}
